library(SingCellaR)
library(ggplot2)
library(circlize)
## ========================================
## circlize version 0.4.12
## CRAN page: https://cran.r-project.org/package=circlize
## Github page: https://github.com/jokergoo/circlize
## Documentation: https://jokergoo.github.io/circlize_book/book/
##
## If you use it in published research, please cite:
## Gu, Z. circlize implements and enhances circular visualization
## in R. Bioinformatics 2014.
##
## This message can be suppressed by:
## suppressPackageStartupMessages(library(circlize))
## ========================================
load(file = "/Users/gwang/DBA/DBA_revision/Objects/DBA_harmony.rdata")
################### Ery ##################
plot_umap_label_by_genes(DBA,gene_list = "EPOR",point.color1 = "#E83323",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "KLF1",point.color1 = "#E83323",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "TFR2",point.color1 = "#E83323",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "APOE",point.color1 = "#E83323",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "APOC1",point.color1 = "#E83323",point.color2 = "black")
################### MyP ##################
plot_umap_label_by_genes(DBA,gene_list = "ELANE",point.color1 = "#A3FB4E",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "AZU1",point.color1 = "#A3FB4E",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "PRTN3",point.color1 = "#A3FB4E",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "MPO",point.color1 = "#A3FB4E",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "CST7",point.color1 = "#A3FB4E",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "CTSG",point.color1 = "#A3FB4E",point.color2 = "black")
######################## MKP #####################
plot_umap_label_by_genes(DBA,gene_list = "PF4",point.color1 = "#7422F5",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "GP9",point.color1 = "#7422F5",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "VWF",point.color1 = "#7422F5",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "SELP",point.color1 = "#7422F5",point.color2 = "black")
######################## LyP #####################
plot_umap_label_by_genes(DBA,gene_list = "IL3RA",point.color1 = "#0080FF",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "LTB",point.color1 = "#0080FF",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "JCHAIN",point.color1 = "#0080FF",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "CD79A",point.color1 = "#0080FF",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "IGHD",point.color1 = "#0080FF",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "IGHM",point.color1 = "#0080FF",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "VPREB1",point.color1 = "#0080FF",point.color2 = "black")
######################## HSC/MPP #####################
plot_umap_label_by_genes(DBA,gene_list = "CRHBP",point.color1 = "orange",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "EMCN",point.color1 = "orange",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "HLF",point.color1 = "orange",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "AVP",point.color1 = "orange",point.color2 = "black")
######################## EoMBP #####################
plot_umap_label_by_genes(DBA,gene_list = "PRG2",point.color1 = "darkslategray",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "LMO4",point.color1 = "darkslategray",point.color2 = "black")
plot_umap_label_by_genes(DBA,gene_list = "CLC",point.color1 = "darkslategray",point.color2 = "black")
freq <- read.csv(file = "/Users/gwang/DBA/DBA_revision/Figures/Figure1/freq_v2.txt",header = T, sep = "\t")
head(freq)
## Celltype RPL11 RPL5
## 1 MyP 0.2593 0.2128
## 2 EoMBP 0.0519 0.0334
## 3 LyP 0.1030 0.1018
## 4 MKP 0.0722 0.0663
## 5 EP 0.1639 0.1396
## 6 HSC/MPP 0.3498 0.4460
freq
## Celltype RPL11 RPL5
## 1 MyP 0.2593 0.2128
## 2 EoMBP 0.0519 0.0334
## 3 LyP 0.1030 0.1018
## 4 MKP 0.0722 0.0663
## 5 EP 0.1639 0.1396
## 6 HSC/MPP 0.3498 0.4460
celltype <- freq$Celltype
percent <- freq$RPL11*100
color = c("#009E73","darkslategray","#0080FF","#7422F5","#CC79A7","orange")
circos.par("start.degree" = 90, cell.padding = c(0, 0, 0, 0))
circos.initialize("a", xlim = c(0, 100)) # 'a` just means there is one sector
circos.track(ylim = c(0.5, length(percent)+0.5), track.height = 0.8,
bg.border = NA, panel.fun = function(x, y) {
xlim = CELL_META$xlim
circos.segments(rep(xlim[1], 6), 1:6,
rep(xlim[2], 6), 1:6,
col = "#CCCCCC")
circos.rect(rep(0, 6), 1:6 - 0.45, percent, 1:6 + 0.45,
col = color, border = "white")
circos.text(rep(xlim[1], 6), 1:6,
paste(celltype, " - ", percent, "%"),
facing = "downward", adj = c(1.05, 0.5), cex = 0.8)
breaks = seq(0, 85, by = 5)
circos.axis(h = "top", major.at = breaks, labels = paste0(breaks, "%"),
labels.cex = 0.6)
})
celltype <- freq$Celltype
percent <- freq$RPL5*100
color = c("#009E73","darkslategray","#0080FF","#7422F5","#CC79A7","orange")
circos.par("start.degree" = 90, cell.padding = c(0, 0, 0, 0))
## Warning: 'start.degree' can only be modified before `circos.initialize`, or
## maybe you forgot to call `circos.clear` in your last plot.
circos.initialize("a", xlim = c(0, 100)) # 'a` just means there is one sector
circos.track(ylim = c(0.5, length(percent)+0.5), track.height = 0.8,
bg.border = NA, panel.fun = function(x, y) {
xlim = CELL_META$xlim
circos.segments(rep(xlim[1], 6), 1:6,
rep(xlim[2], 6), 1:6,
col = "#CCCCCC")
circos.rect(rep(0, 6), 1:6 - 0.45, percent, 1:6 + 0.45,
col = color, border = "white")
circos.text(rep(xlim[1], 6), 1:6,
paste(celltype, " - ", percent, "%"),
facing = "downward", adj = c(1.05, 0.5), cex = 0.8)
breaks = seq(0, 85, by = 5)
circos.axis(h = "top", major.at = breaks, labels = paste0(breaks, "%"),
labels.cex = 0.6)
})